//
//  HMComposeButton.m
//  微博app--OC
//
//  Created by xmy on 16/9/7.
//  Copyright © 2016年 xmy. All rights reserved.
//

#import "HMComposeButton.h"

@implementation HMComposeButton

- (instancetype)initWithFrame:(CGRect)frame;
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupUI];
    }
    return self;
}

- (void)setupUI{
    
    self.imageView.contentMode = UIViewContentModeCenter;
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    
}

//布局子控件
-(void)layoutSubviews{
    
    [super layoutSubviews];
    
    CGFloat width = self.frame.size.width;
    
    CGFloat height = self.frame.size.height;
    
    self.imageView.frame = CGRectMake(0, 0, width, width);
    
    self.titleLabel.frame = CGRectMake(0, 0, width, height - width);
    
}
@end
